package com.phz.springcloud.study.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.AmqpException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.phz.springcloud.study.service.ScoreService;


@RestController
@RequestMapping("/cucc")
public class ScoreController {
	
	protected static final Logger logger = LoggerFactory.getLogger(ScoreController.class);
	
	@Autowired
	ScoreService scoreService;
	
	
	
	@GetMapping("/normal")
	public void normal() throws AmqpException, JsonProcessingException {
		scoreService.generateNormalScore();
	}
	
	@GetMapping("/notfound")
	public void notfound() throws AmqpException, JsonProcessingException {
		scoreService.generateNotFoundScore();;
	}
	
	@GetMapping("/error")
	public void error() throws AmqpException, JsonProcessingException {
		scoreService.generateErrorScore();
	}

}
